package com.yanqu.road.server.timer.wingroom;

import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.wingroom.WingRoomModule;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.manger.wingroom.WingRoomMgr;
import com.yanqu.road.utils.executor.GeneralTask;


public class WingRoomPatronsVisitTask extends GeneralTask {
    @Override
    public void doRun() {
        for (GamePlayer player : GamePlayerMgr.getAllOnlinePlayer()) {
            if (player != null) {
                try {
                    WingRoomModule wingRoomModule = player.getModule(WingRoomModule.class);
                    wingRoomModule.checkUserPatronsVisitData();
                    wingRoomModule.touchUserPatronsVisitData(null);
                }catch (Exception e){
                    WingRoomMgr.getLogger().error("cal PatronsVisit error"  + player.getUserId(), e);
                }
            }
        }
    }
}
